//
//  DKSortArray.h
//  搞起
//
//  Created by Alex on 15-2-4.
//  Copyright (c) 2015年 Alex. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PinYin4Objc.h"
static HanyuPinyinOutputFormat* format;



@class DKSortArray;
@protocol DKSortArrayDataSource
@required

-(NSString*)DKSortArray:(DKSortArray*)object stringOfSortArray:(NSArray*)dataArray AtIndex:(NSUInteger)index;

@end
//-------------------------------------------------------------------------------------


@interface DKSortArray : NSObject

@property NSArray* dataArray;//存放原数据
@property NSMutableArray* convertArray;//存放转换后的数据
@property NSMutableArray* indexArray;//不改变原数组的顺序，只是存储索引到此数组
@property NSMutableArray* titleArray;//标题数组，用于tableView的快速跳转;

@property (nonatomic,weak) id dataSource;

-(void)setArray:(NSArray*)array;

//排序算法
-(void)sort;


//获取对应索引
-(NSUInteger)indexOfSection:(NSUInteger)section AtIndex:(NSUInteger)index;

-(NSUInteger)numberOfSection;
-(NSUInteger)numberOfRowAtSection:(NSUInteger)section;
-(NSArray*)getTitleArray;

//逆向解析
-(NSIndexPath*)indexPathForIndex:(NSUInteger)index isSection:(BOOL)section;

@end
